package name.marz.to.go.ahg.core.executer;

import java.net.URI;

import name.marz.to.go.ahg.common.util.HttpUtil;
import name.marz.to.go.ahg.core.AutoGetterHttpClient;

public abstract class AbstractExecuter<T> implements Executer<T> {

	protected URI uri;
	protected AutoGetterHttpClient client;
	protected String charset;
	protected String pageName;
	
	/**
	 * @param uri
	 * @param client
	 */
	public AbstractExecuter(URI uri, AutoGetterHttpClient client) {
		super();
		this.uri = uri;
		this.client = client;
		this.charset = client.getDefaultCharset();
	}
	/**
	 * @param uri
	 * @param client
	 * @param pageName
	 */
	public AbstractExecuter(URI uri, AutoGetterHttpClient client, String pageName) {
		this(uri,client);
		this.pageName = pageName;
	}
	/**
	 * @param uri
	 * @param client
	 */
	public AbstractExecuter(String uri,AutoGetterHttpClient client) {
		this(HttpUtil.createURISafety(uri),client);
	}
	/**
	 * @param uri
	 * @param client
	 * @param pageName
	 */
	public AbstractExecuter(String uri, AutoGetterHttpClient client, String pageName) {
		this(uri,client);
		this.pageName = pageName;
	}

	public String getPageName() {
		return pageName;
	}
	public void setPageName(String pageName) {
		this.pageName = pageName;
	}

	public String getCharset() {
		return charset;
	}

	public void setCharset(String charset) {
		this.charset = charset;
	}
	
	public URI getUri() {
		return uri;
	}
	public void setUri(URI uri) {
		this.uri = uri;
	}
	/**
	 * @return the client
	 */
	public AutoGetterHttpClient getClient() {
		return client;
	}
}
